package edu.gatech.ealf.components;

import java.awt.Color;
import java.awt.Graphics;

import javax.swing.JComponent;

public class ColorSwatch extends JComponent {

    private static final long serialVersionUID = 1L;
    private Color color;
    
    public ColorSwatch(){
    }
    
    public ColorSwatch(Color color){
        this.color = color;
    }
    
    @Override
    public void paintComponent(Graphics g){
        g.setColor(color);
        g.fillRoundRect(0,0, getWidth(), getHeight(), 10, 10);
    }

    public Color getColor() {
        return color;
    }

    public void setColor(Color color) {
        this.color = color;
    }
    
}
